<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/cases/source/";  //应用的地址名
String listActionName = basePath+"CaseSourceSend.action?op=searchjs";
String addActionName = basePath+"CaseSourceReceive_add.action";
String editActionName = basePath+"CaseSourceReceive_modify.action";
String delActionName = basePath+"CaseSourceReceive_del.action?op=deljs";
String lookActionName = basePath+"CaseSourceReceive.action?op=look";
String downActionName = basePath+"CaseSourceReceive_caseSourceDown.action";
String lookFrameActionName = basePath+"CaseSourceReceive_lookItemFrame.action?";
String excelActionName=basePath+"CaseSourceSend_saExcel.action";
%>
<script language="javascript" src="<%=path %>/js/My97/WdatePicker.js"></script>
<script language="javascript" src="<%=path %>/jslib/orgSelect.js"></script>
<script type="text/javascript">
    		$(function(){
    			$('#inspectDept').orgSelect({
    				inspectDeptId:'inspectDept',
    		        collectDeptId:'collectDept'
    			});
			//表格初始化
			$('#searchTable').grid({
				title:[<ce:menu/>],
				url:'<%=listActionName%>',
				singleSelect:true,
	            queryParams : {
					"search.taxpayerNum" : "",
					"search.involvedEnt" : "",
					"search.caseNum" : "",
					"search.recBeginDate" : "",
					"search.recEndDate" : "",
					"search.caseFrom" : "",
					"search.illegalType" : "",
					"search.inspectDept" : "",
					"search.collectDept" : "",
					"search.state" : ""
					
			    }, //用于查询的参数以及初始值
			//表头列，不建议改动
			frozenColumns : [ [ {
				field : 'ck',
				checkbox : true
			},{
				field : 'isSecret',
				title : '是否保密税源',				
				sortable : true,
				formatter : function(value) {
					if (value == '0') {
						return "否";
					} else if (value == '1') {
						return "是";
					}
				}
			},{
				field : 'taxpayerNumber',
				title : '纳税人识别号',				
				sortable : true
			},{
				field : 'involvedEnterprice',
				title : '涉案企业',
				width : 200,
				sortable : true
			}, {
				field : 'state',
				title : '状态',		
				width : 100,
				sortable : true,
				formatter : function(value,row) {
					var recovation=row.vcRevocation;
					if(recovation=='2'){
						return "已撤销 ";
					}
					var vcJoin=row.vcJoin;
					if(vcJoin=='1'){
						return "已合并";
					}
					var statu=row.vcStatus_;
					var statuInfo='';
					if(0==statu){
						statuInfo="待签收";
					}else if(1==statu){
						statuInfo="已签收";
					}
					
					var endType=row.vcEndType;
					var endInfo='';
					if(1==endType){
						endInfo="中止检查";
					}else if(2==endType){
						endInfo="终止检查";
					}else if(3==endType){
						endInfo="中止执行";
					}else if(4==endType){
						endInfo="终止执行";
					}
					
					if (value == '1') {
						return "选案 "+statuInfo+" "+endInfo;
					} else if (value == '2') {
						return "检查 "+statuInfo+" "+endInfo;
					} else if (value == '3') {
						return "审理 "+statuInfo+" "+endInfo;
					} else if (value == '4') {
						return "执行 "+statuInfo+" "+endInfo;
					} else if (value == '9') {
						return "结案";
					} else if (value == '-2') {
						return "暂存待查";
					}else if(value == ''){
						return "未下达";
					}
				}
			} ] ],
			//数据列，根据显示的内容进行修改
			columns : [ [

			   {
				field : 'registerDept',
				title : '录入机构',
				width : 100
			
			},{
				field : 'isImportant',
				title : '是否重点税源',				
				sortable : true,
				formatter : function(value) {
					if (value == '0') {
						return "否";
					} else if (value == '1') {
						return "是";
					}
				}

			}, {
				field : 'caseFromName',
				title : '案件来源',				
				sortable : true
			}, {
				field : 'downDateString',
				title : '下发日期',				
				sortable : true
			}, {
				field : 'illegalTypeName',
				title : '涉嫌违法类型',				
				sortable : true
			}, {
				field : 'hearIllegalTypeName',
				title : '违法类型',				
				sortable : true
			}, {
				field : 'inspectionDept',
				title : '管辖稽查局',				
				sortable : true
			}, {
				field : 'collectionDept',
				title : '所属征管局',				
				sortable : true
			}

			] ],
			//功能按钮组
			toolbar : [ <ce:jsonBtn/> ]
		});
		//查询操作
		$('#search').click(function() {
			defaultSearchAction();
		});
        $('#resetSearch').click(function(){
			
		});
	});   		
    		
 		//打开查看页面
 		function viewItem(id){
 			var rows = $('#searchTable').datagrid('getSelections');	
 			var num=rows[0].taxpayerNumber;
 			parent.addTabs_(num+'案源查看','<%=lookFrameActionName%>&chkSelf='+id);
 		}
	//点击添加按钮后的操作：打开添加界面
	function openAddPage() {
		//默认的打开添加界面操作(添加页面地址，窗口宽度，窗口高度)
		defaultOpenAddPageHavebtn('<%=addActionName%>',550,350);
		}
		//点击编辑按钮后的操作：打开编辑界面
		function openModifyPage(){
		    //默认的打开编辑界面操作（编辑页面地址，窗口宽度，窗口高度）
            defaultOpenModifyPageHavebtn('<%=editActionName%>',550,350);
		}
		//删除数据操作
		function deleteItems(){
            defaultDeleteItems('<%=delActionName%>');
		}
		//点击帮助按钮后的操作：打开帮助界面
		function openHelpPage(){
		    defaultOpenWindow('<%=path%>/sys/menu/SysMenuHelp_look.action?chkSelf=<%=request.getAttribute("menuId").toString() %>','帮助信息查看',600,600);
		}
       function setSelected(){
    	   
       }
       //下达
       
       function downRow(){
    	   var vcId='';
    	   var rows = $('#searchTable').datagrid('getSelections');					
			if (rows.length>1){
			   $.messager.alert('消息提示','下达案源时请选择单条案源','error');
			}else if(rows.length==1){
				vcId = rows[0].vcId;
			}else{
			   $.messager.alert('消息提示','请选择要下达的案源','error');
			}
    	   defaultOpenWindow('<%=downActionName%>','下发案源',550,350,{chkSelf:vcId},{},{but:[{id:'downBtn',name:'下发',classname:'icon-save'}]});
       }
       function printRow(){
    	   
       }
       function saveAsExcel(){
    	   if($('#saveExcelFrm').length==0){
     			$('<iframe id="saveExcelFrm" name="saveExcelFrm" width=0 height=0></iframe>').appendTo(document.body);
     		}
     		var f = $('form:first');
     		var fa = f.attr('action');
     		f.attr('target','saveExcelFrm');
     		f.attr('action','<%=excelActionName%>');
     		f[0].submit();
     		f.attr('target','');
     		f.attr('action',fa);
       } 
    </script>
<html>
  <head>
    <title></title>
  </head> 
<body class="easyui-layout">
	<form id="excelSearch">
	<div class="div_height_auto" data-options="region:'north',border:false" style="overflow: hidden;" align="left">
		<table>
		<tr>
			<td align="right">纳税人识别号：</td><td><input type="text" id="taxpayerNum" style="width:100px;"/></td>
			<td align="right">涉案企业名称：</td><td><input type="text" id="involvedEnt"  style="width:100px;"/></td>
			<td align="right">案源编号：</td><td><input type="text" id="caseNum"  style="width:100px;"/></td>
			<td align="right">下发日期：</td>
			<td><input type="text" id="recBeginDate" style="width:100px;" class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm'})" readonly="true"/>&nbsp;至&nbsp;
			    <input type="text" id="recEndDate"  style="width:100px;"  class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm'})" readonly="true"/>
			</td>
		</tr>
		<tr>
			<td align="right">案件来源：</td><td><ce:dictSelect id="caseFrom" name="caseFrom"  dictName="备选案源台账-案件来源" allOption="true" style="width:100px;"/></td>
			<td align="right">涉嫌违法类型：</td><td><ce:dictSelect id="illegalType"  name="illegalType"  dictName="备选案源台账-涉嫌违法类型" allOption="true" style="width:100px;"/></td>
			<td align="right">所属稽查局：</td><td><select  id="inspectDept"  style="width:100px;"/></select></td>
			<td align="right">所属征管局：</td>
			<td colspan="2">
			<select type="text" id="collectDept"  style="width:100px;"></select>
			</td>
			<td rowspan="3">
			   <a id="search" href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-search">查询</a>
			   <a id="resetSearch" href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-redo">重置</a>
			</td>
		</tr>
		<tr>
		<!-- 2015-05-20 by 修改，开始 -->
		<!-- 【案件状态】新增条件项，“已终止”，“重启”
		<td align="right">案件状态：</td><td colspan="5"><s:select name="search.state"  list="#{'':'--全部--','1':'选案','2':'检查','3':'审理','4':'执行','-2':'暂存待查','9':'结案','101':'已合并','102':'已撤销','103':'已中止'}" style="width:100px" id="state"/></td>
		 -->
		<td align="right">案件状态：</td><td colspan="5"><s:select name="search.state"  list="#{'':'--全部--','1':'选案','2':'检查','3':'审理','4':'执行','-2':'暂存待查','9':'结案','101':'已合并','102':'已撤销','103':'已中止','104':'已终止'}" style="width:100px" id="state"/></td>
		<!-- 2015-05-20 by 修改，结束 -->

		</tr>
		</table>
	</div>

	<div data-options="region:'center',border:false" style="overflow: hidden;">
		<table id="searchTable"></table>
	</div>

</form>
	
</body>



</html>
   
   

